<div id="userupdate">
	<div class="userupdate">
		<div class="row">
		<div class="col-xs-12">
			<div class="box box-info">
				<form id="user-form" name="user-form" class="form-horizontal bv-form" novalidate="novalidate">
					<div class="box-header">
						<div class="col-xs-12 text-center">
							<div class="avatar-container text-center">
								<img src="/static/dist/img/user2-160x160.jpg" id="avatarImg" class="avatar-img">
							</div>
							<div>
								<button type="button" class="btn btn-sm btn-camera" data-btn-type="upload"><i class="fa fa-camera">&nbsp;上传/更改头像</i></button>
							</div>
						</div>
					</div>
					<div class="box-body">
						<div class="col-md-6">
							<div class="form-group has-feedback">
								<label for="birthday" class="col-sm-3 control-label">昵称</label>
								<div class="input-group date col-sm-8" style="padding-left: 15px; padding-right: 15px;">
									<input type="text" class="form-control username" data-flag="datepicker" name="username" placeholder="昵称" data-bv-field="birthday"><i class="form-control-feedback" data-bv-icon-for="birthday" style="display: none;"></i>
									<small data-bv-validator="notEmpty" data-bv-validator-for="birthday" class="help-block" style="display: none;">请输入出生日期</small><small data-bv-validator="date" data-bv-validator-for="birthday" class="help-block" style="display: none;">请输入有效日期</small></div>
							</div>
							<div class="form-group">
								<label for="telphone" class="col-sm-3 control-label">姓名</label>

								<div class="col-sm-6">
									<input type="text" class="form-control" readonly="readonly" id="name" name="nickname" placeholder="姓名" data-bv-field="nickname"><i class="form-control-feedback" data-bv-icon-for="name" style="display: none;"></i>
								</div>
							</div>
							<div class="form-group">
								<label for="telphone" class="col-sm-3 control-label">邮箱</label>
								<div class="col-sm-8">
									<input type="email" readonly="readonly" class="form-control" id="telphone" name="email" placeholder="座机">
								</div>
							</div>
						</div>
						<div class="col-md-6">
							<div class="form-group has-feedback">
								<label for="email" class="col-sm-3 control-label">电话</label>
								<div class="col-sm-8">
									<input type="text" class="form-control" id="email" name="phone" placeholder="Email" data-bv-field="email"><i class="form-control-feedback" data-bv-icon-for="email" style="display: none;"></i>
									<small data-bv-validator="notEmpty" data-bv-validator-for="email" class="help-block" style="display: none;">请输入邮件</small><small data-bv-validator="emailAddress" data-bv-validator-for="email" class="help-block" style="display: none;">非法的邮件格式</small></div>
							</div>
							<div class="form-group has-feedback">
								<label class="col-sm-3 control-label">性别</label>

								<div class="col-sm-8">
									<span style="position: relative;top: -4px;margin-right: 5px;">男</span><input type="radio" id="man" name="sex" style="width: 20px;height: 20px;outline: none;" value="男"><i class="form-control-feedback" data-bv-icon-for="email" style="display: none;"></i>
									<span style="position: relative;top: -4px;margin-right: 5px;">女</span><input type="radio" id="wman" name="sex" style="width: 20px;height: 20px;outline: none;" value="女"><i class="form-control-feedback" data-bv-icon-for="email" style="display: none;"></i>
									<!--<label class="control-label"> <div class="iradio_square-green" aria-checked="false" aria-disabled="false" style="position: relative;"><input type="radio" name="sex" data-flag="icheck" class="square-green" value="1" data-bv-field="sex" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins></div> 男
                                    </label> &nbsp; <label class="control-label"> <div class="iradio_square-green" aria-checked="false" aria-disabled="false" style="position: relative;"><input type="radio" name="sex" data-flag="icheck" class="square-green" value="0" data-bv-field="sex" style="position: absolute; opacity: 0;"><ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins></div><i class="form-control-feedback" data-bv-icon-for="sex" style="display: none;"></i> 女
                                </label>-->
									<small data-bv-validator="notEmpty" data-bv-validator-for="sex" class="help-block" style="display: none;">请选择性别</small></div>
							</div>
							<div class="form-group has-feedback">
								<label for="loginName" class="col-sm-3 control-label">住址</label>

								<div class="col-sm-8">
									<input type="text" class="form-control" name="address" data-bv-field="loginName"><i class="form-control-feedback" data-bv-icon-for="loginName" style="display: none;"></i>
									<small data-bv-validator="notEmpty" data-bv-validator-for="loginName" class="help-block" style="display: none;">请输入登录名</small></div>
							</div>
							<div class="form-group">
								<label for="mobile" class="col-sm-3 control-label">权限等级</label>

								<div class="col-sm-8">
									<input type="text" class="form-control" id="mobile" name="rolrid" placeholder="手机" value="3">
								</div>
							</div>
						</div>
						<!-- /.box-body -->
					</div>
					<div class="box-footer text-right">
						<!--以下两种方式提交验证,根据所需选择-->
						<button type="button" id="tuichu" class="btn btn-primary" data-btn-type="cancel">取消</button>
						<button type="submit" id="caozuo" class="btn btn-primary" data-btn-type="save">修改</button>
					</div>
					<!-- /.box-footer -->
					<input type="hidden" value=""></form>
			</div>
		</div>
	</div>
	</div>
</div>
<script src="/static/dist/js/json.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function() {
//		var Sex;
//		$("#user-form").bootstrapValidator({
//			fields: {
//				username: {
//					validators: {
//						notEmpty: {
//							message: '昵称不能为空'
//						},
//						usernameAddress: {
//							message: 'nicheng'
//						}
//					}
//				},
//				nickname: {
//					validators: {
//						notEmpty: {
//							message: '姓名不能为空'
//						},
//						nicknameAddress: {
//							message: '请输入有效的邮箱地址'
//						}
//					}
//				},
//				email: {
//					validators: {
//						notEmpty: {
//							message: '邮箱不能为空'
//						},
//						emailAddress: {
//							message: '请输入有效的邮箱地址'
//						}
//					}
//				},
//				phone: {
//					validators: {
//						notEmpty: {
//							message: '电话不能为空'
//						},
//						phoneAddress: {
//							message: '请输入有效的邮箱地址'
//						}
//					}
//				},
//				sex: {
//					validators: {
//						notEmpty: {
//							message: '性别不能为空'
//						},
//						sexAddress: {
//							message: '请输入有效的邮箱地址'
//						}
//					}
//				},
//				address: {
//					validators: {
//						notEmpty: {
//							message: '地址不能为空'
//						},
//						addressAddress: {
//							message: '请输入有效的邮箱地址'
//						}
//					}
//				},
//				rolrid: {
//					validators: {
//						notEmpty: {
//							message: '权限不能为空'
//						},
//						rolridAddress: {
//							message: '请输入有效的邮箱地址'
//						}
//					}
//				}
//
//			}
//		}).on('success.form.bv', function(event, data) {
//			event.preventDefault();
//			Sex = $('input:radio[name="sex"]:checked').prev().html();
//			$.ajax({
//				type: "post",
//				url: "/user/update",
//				data: {
//					UserName: $("[name=username]").val(),
//					NickName: $("[name=nickname]").val(),
//					Email: $("[name=email]").val(),
//					Phone: $("[name=phone]").val(),
//					Sex: Sex,
//					Address: $("[name=address]").val(),
//					RolrID: $("[name=rolrid]").val()
//				},
//				success: function(data) {
//					var respone = $.parseJSON(data);
//					if(respone.code == 1) {
//						alert("修改成功");
//						//window.location.reload();
//						table.draw(false);
//					} else if(respone.code == 0) {
//						alert("添加失败");
//					}
//				}
//			});
//		});
	})
</script>